<template>
  <div>
    <div class="allowance-edit">
      <span class="edit-button">
        <el-button type="primary" size="small" round @click="parent.doClose()">取消</el-button>
      </span>
      <span v-if="showSave" class="edit-button">
        <el-button type="primary" size="small" round @click="parent.doSave()">保存</el-button>
      </span>
      <span v-if="showSubmit" class="edit-button">
        <el-button type="primary" size="small" round @click="parent.doSubmit()">提交</el-button>
      </span>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    parent: {
      type: Object,
      default: null
    },
    currentOperate: {
      type: String,
      default: null
    }
  },
  computed: {
    showSave() {
      return this.currentOperate !== 'VIEW'
    },
    showSubmit() {
      return this.currentOperate !== 'VIEW'
    }
  }
}
</script>
<style>
  .allowance-edit {
      text-align: center;
    }
  .edit-button {
    padding: 0 15px 0 15px;
  }
</style>

